package com.poly.common.core.web.page;

import java.io.Serializable;
import java.util.List;

public class SimplePage<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    protected long total = 0;

    /**
     * 列表数据
     */
    protected List<T> rows;

    public static int checkPageNo(Integer pageNum) {
        return (pageNum == null || pageNum < 1) ? 1 : pageNum;
    }

    public SimplePage() {

    }

    public SimplePage(long total,List<T> rows) {
        this.total=total;
        this.rows=rows;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        if (total == null || total < 0) {
            this.total = 0;
        } else {
            this.total = total;
        }
    }
    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }
}